<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- React核心包 最先引入  提供一个对象React -->
  <script src="../../react资料_stu/依赖包/react.development.js"></script>
  <!-- ReactDOM包  提供一个对象ReactDOM -->
  <script src="../../react资料_stu/依赖包/react-dom.development.js"></script>
  <!-- babel -->
  <script src="../../react资料_stu/依赖包/babel.min.js"></script>
</head>

<body>
  <!-- react操作的容器 -->
  <div id="app">

  </div>
</body>
<script type="text/babel">

  class Fu extends React.Component {
    
    content = ()=>{
      // 组件实列
      console.log(this);
      //给组件实列挂载一个iptEle
      console.log(this.iptEle);
      const {value} = this.iptEle.current;
      alert(value)
     
    }
    iptEle = React.createRef();
    render() {
      return (<div>
        <input type="text" ref={this.iptEle} />
        <button onClick={this.content}>点我弹出用户的输入内容</button>
      </div>)
    }

  }
  




  //创建容器并渲染虚拟DOM

  const root = ReactDOM.createRoot(document.getElementById('app'));
  root.render(<Fu />)



</script>

</html>